/**
 @file sys_usw_mcu.c

 @author  Copyright (C) 2011 Centec Networks Inc.  All rights reserved.

 @date 2011-11-22

 @version v2.0

*/

/****************************************************************************
 *
* Header Files
*
****************************************************************************/
#include "sal.h"
#include "ctc_error.h"
#include "ctc_debug.h"

#include "sys_usw_common.h"
#include "sys_usw_datapath.h"
#include "sys_usw_mac.h"
#include "sys_usw_mcu.h"

#include "drv_api.h"
#include "usw/include/drv_chip_ctrl.h"
#include "usw/include/drv_common.h"

extern sys_datapath_master_t* p_usw_datapath_master[];

const int32 g_usw_mcu_prog[] = 
{
    0x00232002, 0x00000000, 0x02000000, 0x90e4de1e, 0xa3f000c8, 0xa3f0a3f0, 0xa3f0a3f0, 0xa3f0a3f0, 0x00a40812, 0x90000000, 
    0x08120bc8, 0x000000a4, 0x0fc89000, 0x00a40812, 0x90000000, 0x081213c8, 0x000000a4, 0x17c89000, 0x00a40812, 0x7b000000, 
    0x79c87a01, 0x88221200, 0xe000c890, 0x001890ff, 0xf0e4a3f0, 0xf0a3f0a3, 0xff0270ef, 0x7f007e22, 0x7bff7d40, 0x79c87a01, 
    0xef08121b, 0x407f007e, 0x017bff7d, 0x5b79c87a, 0x7eef0812, 0x7d407f00, 0x7a017b00, 0x129b79c8, 0xc990ef08, 0x0370e047, 
    0xe4620502, 0x49c990f0, 0xe0a3fce0, 0xfee0a3fd, 0x0124e0a3, 0xfe3ee4ff, 0xe4fd3de4, 0xc990fc3c, 0x98081249, 0xfeffff74, 
    0x90007cfd, 0xf8e049c9, 0xa3f9e0a3, 0xe0a3fae0, 0x0712c3fb, 0x900a40d2, 0x081249c9, 0x000000a4, 0x49c99001, 0xe0a3a3a3, 
    0x041890ff, 0xc990f0ef, 0xa3fce049, 0xe0a3fde0, 0xffe0a3fe, 0x07120878, 0x051890e3, 0xc990f0ef, 0xa3fce049, 0xe0a3fde0, 
    0xffe0a3fe, 0x07121078, 0x061890e3, 0xc990f0ef, 0xa3fce049, 0xe0a3fde0, 0xffe0a3fe, 0x07121878, 0x071890e3, 0x90e4f0ef, 
    0x7ef002c8, 0x7d107f00, 0x7a017b00, 0x12dc79c8, 0xc890ef08, 0x7bffe002, 0x79c87a01, 0x521c12dc, 0xe002c890, 0xa410f075, 
    0x24f0aafb, 0x34eaff00, 0xfce4fe04, 0x07c890fd, 0xe4980812, 0x34eaff2b, 0xfce4fe1c, 0x0bc890fd, 0xe4980812, 0xf006c890, 
    0xa307c890, 0xa3fee0a3, 0xc890ffe0, 0x7cfde006, 0xff2def00, 0x828f3eec, 0xfae083f5, 0xa30bc890, 0xa3fee0a3, 0x2defffe0, 
    0x8f3eecff, 0xea83f582, 0x06c890f0, 0xe0f004e0, 0x90c510b4, 0xffe002c8, 0xc87a017b, 0x21120179, 0x02c89037, 0xc890ffe0, 
    0x7dfbe001, 0x8f1f1203, 0xe001c890, 0x03020370, 0xe5c8907e, 0x020360e0, 0xc8907e03, 0x0360e0e3, 0x907e0302, 0xffe0e1c8, 
    0x1c600d64, 0x600764ef, 0x0e64ef17, 0x64ef1260, 0xef0d6001, 0x08600564, 0x600664ef, 0x7e030203, 0xe0ddc890, 0xfde0a3ff, 
    0xc87a017b, 0x0e120379, 0x9533efcd, 0xfcfdfee0, 0x12ecc890, 0xc8909808, 0xa3fce0ec, 0xa3fee0a3, 0x33ecffe0, 0x90220150, 
    0xffe002c8, 0x7dfbe0a3, 0x8f1f1201, 0x1712ffe4, 0x9533ef41, 0xfcfdfee0, 0x12ecc890, 0xc8909808, 0xa3fce0ec, 0xa3fee0a3, 
    0x33ecffe0, 0x90220150, 0xffe0ddc8, 0x90fde0a3, 0x0174f3c8, 0xc874a3f0, 0xe474a3f0, 0x0174a3f0, 0xc874a3f0, 0x0474a3f0, 
    0x0174a3f0, 0xc874a3f0, 0xdb74a3f0, 0x03c890f0, 0x0912fbe0, 0x9533efcf, 0xfcfdfee0, 0x12ecc890, 0xc8909808, 0xa3fce0ec, 
    0xe0a3fde0, 0x33eca3fe, 0xffe40e50, 0x909a1812, 0xa3a3ecc8, 0x22ffe0a3, 0xe0e4c890, 0x07c890fb, 0xfee0a3a3, 0x24ffe0a3, 
    0xe482f508, 0xeb83f53e, 0x2f0974f0, 0x3ee482f5, 0xf0e483f5, 0xf52f0a74, 0xf53ee482, 0x74f0e483, 0x82f52f0b, 0x83f53ee4, 
    0x12fff0e4, 0x33ef9a18, 0xfdfee095, 0xecc890fc, 0x90980812, 0xfce0ecc8, 0xe0a3a3a3, 0x5033ecff, 0xc8902201, 0x60ffe004, 
    0x0174a335, 0x02c890f0, 0x1b24fee0, 0x34e482f5, 0xee83f5c8, 0xdbc890f0, 0xc890fee0, 0x24fde002, 0xe482f55b, 0x83f5c834, 
    0x9b74f0ee, 0xe482f52d, 0x83f5c834, 0xc890f0ef, 0xf004e002, 0x4094c3e0, 0x01020350, 0x05c89043, 0x020370e0, 0xc9906205, 
    0xfefbe048, 0xa404f075, 0x2ef0e5ff, 0xff2fe4fe, 0xfe6034ee, 0x90fdfce4, 0x08120fc8, 0x0fc89098, 0xfee0a3a3, 0x82f5e0a3, 
    0xf0eb838e, 0xa30fc890, 0xa3fee0a3, 0x82f5ffe0, 0xe4a3838e, 0x8e828ff0, 0xf0a3a383, 0x838e828f, 0xf0a3a3a3, 0xe048c990, 
    0xf0341890, 0xa3f0e4a3, 0x90f0a3f0, 0x90f002c8, 0x081213c8, 0x9e5400a4, 0x13c89000, 0xe0a3f8e0, 0xfae0a3f9, 0xc0fbe0a3, 
    0xc001c000, 0x9003c002, 0x13e002c8, 0xff3f5413, 0x9f0f74c3, 0x0094e4ff, 0x0278effe, 0x33ce33c3, 0xfff9d8ce, 0xd0fdfce4, 
    0xd002d003, 0xeb00d001, 0x3eeaff2f, 0xfd39edfe, 0x90fc38ec, 0x081213c8, 0x13c89098, 0xe0a3fce0, 0xfee0a3fd, 0x7bffe0a3, 
    0x79c87a01, 0x3b111217, 0xe017c890, 0xfde0a3fc, 0xa3fee0a3, 0xc890ffe0, 0x0354e002, 0xa408f075, 0x0712f8f9, 0x1f54efe3, 
    0xc890e4ff, 0x90f0efdb, 0xfee048c9, 0xa404f075, 0x2ef0e5ff, 0xff2fe4fe, 0xfe6034ee, 0x90fdfce4, 0x08120fc8, 0x0fc89098, 
    0xe0a3f8e0, 0xfae0a3f9, 0x90fbe0a3, 0x75e002c8, 0x24a404f0, 0x35e4ff04, 0xfce4fef0, 0xff2febfd, 0xedfe3eea, 0x38ecfd39, 
    0x0fc890fc, 0x90980812, 0x24e002c8, 0xe482f51b, 0x83f5c834, 0xc890fbe0, 0xe0a3a30f, 0xf5e0a3fe, 0xeb838e82, 0x02c890f0, 
    0x9b24fbe0, 0x34e482f5, 0xe083f5c8, 0x0fc890fa, 0xfee0a3a3, 0xf5ffe0a3, 0xa3838e82, 0x5b74f0ea, 0xe482f52b, 0x83f5c834, 
    0x8e828fe0, 0xf0a3a383, 0xe0dbc890, 0x0fc890fb, 0xfee0a3a3, 0x82f5e0a3, 0xa3a3838e, 0x90f0eba3, 0x04e002c8, 0x94c3e0f0, 
    0x02035040, 0xc990f703, 0xf004e048, 0x0264b4e0, 0x007ff0e4, 0xf609e722, 0x80fadf08, 0xf209e746, 0x80fadf08, 0x8c82883e, 
    0xf009e783, 0x80fadfa3, 0xf609e332, 0x80fadf08, 0xf209e378, 0x80fadf08, 0x8c828870, 0xf009e383, 0x80fadfa3, 0x8a828964, 
    0xf6a3e083, 0x80fadf08, 0x8a828958, 0xf2a3e083, 0x80fadf08, 0x80d2804c, 0x80c680fa, 0x806980d4, 0x803380f2, 0x80a68010, 
    0x809a80ea, 0x80da80a8, 0x80ca80e2, 0x8a828933, 0xe4faec83, 0xc5c8a393, 0xc5ccc882, 0xa3f0cc83, 0xc882c5c8, 0xcc83c5cc, 
    0xe7dee9df, 0x82890d80, 0x93e4838a, 0xdf08f6a3, 0xa9faecf9, 0x22fbedf0, 0x838a8289, 0xa3e0faec, 0xc882c5c8, 0xcc83c5cc, 
    0xc5c8a3f0, 0xc5ccc882, 0xeadfcc83, 0xdb80e8de, 0x838a8289, 0xf2a393e4, 0x80f9df08, 0xeff088cc, 0x4e0e0160, 0xf088c360, 
    0xb40224ed, 0xb9500004, 0x24eb82f5, 0x0004b402, 0x2323af50, 0x90238245, 0xbb73b505, 0x82890601, 0x22e0838a, 0x22e70250, 
    0xe302febb, 0x8a828922, 0x2293e483, 0x890601bb, 0xf0838a82, 0xf7025022, 0x01febb22, 0xbbf822f3, 0x82e50d01, 0xe582f529, 
    0x83f53a83, 0x5022f0e8, 0x8225e906, 0xbb22f6c8, 0x25e905fe, 0x22f2c882, 0xa4f08fe8, 0xa4f08bcc, 0x8ee9fc2c, 0xfc2ca4f0, 
    0xa4edf08a, 0x8eeafc2c, 0xa8cda4f0, 0xa4f08bf0, 0x2538cc2d, 0x8fe9fdf0, 0xcd2ca4f0, 0xebfcf035, 0xfea4f08e, 0x8febf0a9, 
    0xc5cfa4f0, 0x39cd2ef0, 0xfc3ce4fe, 0xce2da4ea, 0xe4fdf035, 0x7522fc3c, 0x827508f0, 0xff2fef00, 0xcdfe33ee, 0x33cccd33, 
    0x3382c5cc, 0xed9b82c5, 0xe599ec9a, 0x0c409882, 0x9bee82f5, 0xfd9aedfe, 0x0ffc99ec, 0xe4d6f0d5, 0xcde4fbce, 0xf9cce4fa, 
    0xb82282a8, 0x00b9c100, 0x2d00ba59, 0x84f08bec, 0xfccdcecf, 0xf9cbf0e5, 0x2fef1878, 0xfe33eeff, 0xecfd33ed, 0x33ebfc33, 
    0x03d710fb, 0xeb044099, 0xd80ffb99, 0xfaf9e4e5, 0xef187822, 0x33eeff2f, 0xfd33edfe, 0xc9fc33ec, 0xd710c933, 0x9ae99b05, 
    0x9bec0740, 0xf99ae9fc, 0xe4e0d80f, 0xcce4fac9, 0xf07522fb, 0xff2fef10, 0xedfe33ee, 0x33ccfd33, 0xc833c8cc, 0x9b07d710, 
    0x99e89aec, 0x9bed0a40, 0xfc9aecfd, 0x0ff899e8, 0xe4daf0d5, 0xcce4fbcd, 0xf9c8e4fa, 0xcff4cf22, 0xcdcef4ce, 0xf4cccdf4, 
    0x9feb22cc, 0x9eeaf0f5, 0x9de9f042, 0x9ce8f042, 0xe822f045, 0xc3ec0f60, 0x13edfc13, 0xfe13eefd, 0xd8ff13ef, 0x60e822f1, 
    0x33c3ef0f, 0xfe33eeff, 0xecfd33ed, 0xf1d8fc33, 0x0701bb22, 0x838a8289, 0x50270902, 0x02f8e905, 0xfebb1b09, 0x02f8e905, 
    0x82893309, 0x0902838a, 0x0701bb3f, 0x838a8289, 0x50980802, 0x02f8e905, 0xfebb8509, 0x02f8e905, 0xbb229109, 0x82890701, 
    0x0902838a, 0xe905505c, 0x4f0902f8, 0xe905febb, 0x680902f8, 0x838a8289, 0x74750902, 0x9533ff01, 0xfcfdfee0, 0xe0a3a3a3, 
    0xe5f0ff2f, 0x70821582, 0xe0831502, 0xe5f0fe3e, 0x70821582, 0xe0831502, 0xe5f0fd3d, 0x70821582, 0xe0831502, 0x22f0fc3c, 
    0xeda3f0ec, 0xf0eea3f0, 0x22f0efa3, 0x838582a8, 0xd083d0f0, 0xbb081282, 0x12bb0812, 0x0812bb08, 0xe473e4bb, 0x83c5a393, 
    0x83c5f0c5, 0xc882c5c8, 0x83c5a3f0, 0x83c5f0c5, 0xc882c5c8, 0x0701bb22, 0x838a8289, 0x50a40802, 0x02f8e905, 0xfebb9d09, 
    0x02f8e905, 0xef22b609, 0xef12604e, 0xed0e0160, 0x890b01bb, 0xf0838a82, 0xdefcdfa3, 0xf08922fa, 0x09f70750, 0xf0a9fcdf, 
    0xfcfebb22, 0xfcdf09f3, 0xe622f0a9, 0xfde608fc, 0x08fee608, 0xe022ffe6, 0xfde0a3fc, 0xa3fee0a3, 0xe222ffe0, 0xfde208fc, 
    0x08fee208, 0xe422ffe2, 0x0174fc93, 0x0274fd93, 0x0374fe93, 0xe622ff93, 0xf9e608fb, 0x08fae608, 0x22f8cbe6, 0xe0a3f8e0, 
    0xfae0a3f9, 0x22fbe0a3, 0xe208fbe2, 0xfae208f9, 0xf8cbe208, 0xf893e422, 0xf9930174, 0xfa930274, 0xfb930374, 0x08f6ec22, 
    0xee08f6ed, 0xf6ef08f6, 0x08f2ec22, 0xee08f2ed, 0xf2ef08f2, 0xd083d022, 0xf693e482, 0x93017408, 0x027408f6, 0x7408f693, 
    0x74f69303, 0x83d07304, 0x93e482d0, 0x017408f2, 0x7408f293, 0x08f29302, 0xf2930374, 0x90730474, 0xf0edf1c8, 0x90f0eba3, 
    0xf0eff0c8, 0xc890e4fa, 0x12a3f0fc, 0x0000a408, 0xc9900000, 0xa4081201, 0x00000000, 0x1205c990, 0x0000a408, 0xfbe40000, 
    0xf009c990, 0xa40812a3, 0x00000000, 0x0ec990e4, 0xa3f0a3f0, 0xf3c890f0, 0xe0a3fbe0, 0xf9e0a3fa, 0xfe5b0612, 0xc8900870, 
    0x0270e0f2, 0xb4ee0b80, 0xc8901801, 0x01b4e0f2, 0xf6c89011, 0xe0a3fbe0, 0xf9e0a3fa, 0x740612e4, 0xc89022ff, 0xa3fbe0f3, 
    0xe0a3fae0, 0x5b0612f9, 0x0b020360, 0xf2c89037, 0x600164e0, 0x370b0203, 0x74061204, 0xe0f6c890, 0xfae0a3fb, 0x74f9e0a3, 
    0x74061201, 0x120ac990, 0x5400a408, 0xc990009e, 0xa3f8e00a, 0xe0a3f9e0, 0xfbe0a3fa, 0x01c000c0, 0x03c002c0, 0xe0f0c890, 
    0x3f541313, 0x0f74c3ff, 0x94e4ff9f, 0x78effe00, 0xce33c302, 0xf9d8ce33, 0xfdfce4ff, 0x02d003d0, 0x00d001d0, 0xeaff2feb, 
    0x39edfe3e, 0xfc38ecfd, 0x120ac990, 0xc9909808, 0xa3fce00a, 0xe0a3fde0, 0xffe0a3fe, 0xc97a017b, 0x11120579, 0x05c9903b, 
    0xe0a3fce0, 0xfee0a3fd, 0x90ffe0a3, 0x54e0f0c8, 0x08f07503, 0x12f8f9a4, 0x54efe307, 0xc890ff1f, 0xa3fbe0f9, 0xe0a3fae0, 
    0x0612eff9, 0xf0c89074, 0xe0a3ffe0, 0x12017bfd, 0xc8905c0c, 0x7dffe0f0, 0xe7151201, 0x90590c02, 0xfbe0f3c8, 0xa3fae0a3, 
    0x0612f9e0, 0x6001645b, 0x590c0203, 0xe0f2c890, 0x0c020360, 0x74061259, 0xe0f6c890, 0xfae0a3fb, 0x74f9e0a3, 0x74061202, 
    0xe0f0c890, 0x12fde4ff, 0xc890e715, 0x7bffe0f0, 0x79c87a01, 0x111e12fc, 0xe0fcc890, 0xc8900a70, 0x7dffe0f0, 0x411b1201, 
    0x007e017f, 0x007c007d, 0x90af2012, 0x08120ac9, 0x9e5400a4, 0x0ac99000, 0xe0a3f8e0, 0xfae0a3f9, 0xc0fbe0a3, 0xc001c000, 
    0x9003c002, 0x13e0f0c8, 0xff3f5413, 0x9f0f74c3, 0x0094e4ff, 0x0278effe, 0x33ce33c3, 0xfff9d8ce, 0xd0fdfce4, 0xd002d003, 
    0xeb00d001, 0x3eeaff2f, 0xfd39edfe, 0x90fc38ec, 0x08120ac9, 0x0ac99098, 0xe0a3fce0, 0xfee0a3fd, 0x7bffe0a3, 0x79c97a01, 
    0x3b111205, 0xe005c990, 0xfde0a3fc, 0xa3fee0a3, 0xc890ffe0, 0x0354e0f0, 0xa408f075, 0x0712f8f9, 0x1f54efe3, 0xf9c890ff, 
    0xe0a3fbe0, 0xf9e0a3fa, 0x740612ef, 0xe0f0c890, 0xfde0a3ff, 0x0c12fbe4, 0xfcc8905c, 0x900a70e0, 0xffe0f0c8, 0x1b12fde4, 
    0x22007f41, 0xef11c990, 0xf0eba3f0, 0xf5e405aa, 0xf50af50b, 0xf508f509, 0xf50ef50f, 0xf50cf50d, 0xaf11f510, 0xc990f902, 
    0xa3f0c91b, 0xf0e9a3f0, 0x007a007b, 0x21121079, 0x11c990ba, 0xf50354e0, 0x10601411, 0x14136014, 0x03241560, 0x75e41b70, 
    0x0f80400b, 0x200b75e4, 0xf5e40980, 0xe404800b, 0xf5100b75, 0xf509f50a, 0xb410e508, 0x03400010, 0x90df0d02, 0x28f8d20c, 
    0x0d027328, 0x0d0d0202, 0x02180d02, 0x0d02230d, 0x390d022e, 0x02440d02, 0x0d024f0d, 0x650d025a, 0x02760d02, 0x0d02860d, 
    0xa80d0297, 0x02b90d02, 0x25e4ca0d, 0xe50bf50b, 0x8060340a, 0x0b25e461, 0x0ae50bf5, 0x56806134, 0xf50b25e4, 0x340ae50b, 
    0xe44b80a0, 0x0bf50b25, 0xa1340ae5, 0x25e44080, 0xe50bf50b, 0x80e0340a, 0x0b25e435, 0x0ae50bf5, 0x2a80e134, 0xf50b25e4, 
    0x340ae50b, 0xe41f8080, 0x0bf50b25, 0x81340ae5, 0x25e41480, 0xe50bf50b, 0x80c0340a, 0x0b25e409, 0x0ae50bf5, 0x0af5c134, 
    0x123409e5, 0x25e46280, 0xe40bf50b, 0x0af50a35, 0x133409e5, 0x25e45280, 0xe50bf50b, 0xf501340a, 0x3409e50a, 0xe4418013, 
    0x0bf50b25, 0x40340ae5, 0x09e50af5, 0x30801534, 0xf50b25e4, 0x340ae50b, 0xe50af5c0, 0x80143409, 0x0b25e41f, 0x0ae50bf5, 
    0x0af58034, 0x143409e5, 0x25e40e80, 0xe40bf50b, 0x0af50a35, 0x153409e5, 0x35e409f5, 0xaf08f508, 0xad0aae0b, 0x7b08ac09, 
    0x79007a00, 0x3b11120c, 0xe09533ef, 0x90fcfdfe, 0x081213c9, 0x13c99098, 0xa3a3fce0, 0xecffe0a3, 0x22015033, 0xe012c990, 
    0x603ec990, 0xa3fce026, 0xe0a3fde0, 0xffe0a3fe, 0x07121078, 0x4f0fe5f6, 0x0ee50ff5, 0xe50ef54e, 0x0df54d0d, 0xf54c0ce5, 
    0xe027800c, 0xfde0a3fc, 0xa3fee0a3, 0x1078ffe0, 0x12f60712, 0x0fe5c507, 0xe50ff55f, 0x0ef55e0e, 0xf55d0de5, 0x5c0ce50d, 
    0x0faf0cf5, 0x0dad0eae, 0xc9900cac, 0x9808121b, 0x0aae0baf, 0x08ac09ad, 0xef3d1d12, 0xfee09533, 0xc990fcfd, 0x98081213, 
    0xe013c990, 0xa3a3a3fc, 0x33ecffe0, 0x90220150, 0xffe012c9, 0xfefdfce4, 0x1218c990, 0x0baf9808, 0x09ad0aae, 0xc99008ac, 
    0x9808121c, 0x0eae0faf, 0x0cac0dad, 0x1220c990, 0xc9909808, 0x12ffe011, 0x007f8514, 0xf0c89022, 0xeda3f0ef, 0xf0eba3f0, 
    0xa3f0eaa3, 0xf5e4f0e9, 0xf50af50b, 0x7808f509, 0x7dc87cf5, 0x7aff7b01, 0xfe037900, 0x0612087f, 0x0cf5e435, 0x0ef50df5, 
    0xc8900ff5, 0x90ffe0f1, 0xf0e41bc9, 0xf0a3f0a3, 0x79007afb, 0xba21120e, 0xe0f0c890, 0x0ff50354, 0x10b40ee5, 0x02034000, 
    0x0f90aa10, 0x2828f831, 0x610f0273, 0x02740f02, 0x0f02870f, 0xab0f0299, 0x02bd0f02, 0x0f02cf0f, 0xf30f02e1, 0x02051002, 
    0x10021c10, 0x47100231, 0x025d1002, 0x10027310, 0x750fe589, 0xaea408f0, 0x74c3fbf0, 0x74ff9b70, 0x15100260, 0xf0750fe5, 
    0xf0aea408, 0x7074c3fb, 0x6174ff9b, 0xe5151002, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x80a074ff, 0x750fe57c, 0xaea408f0, 
    0x74c3fbf0, 0x74ff9b70, 0xe56a80a1, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x80e074ff, 0x750fe558, 0xaea408f0, 0x74c3fbf0, 
    0x74ff9b70, 0xe54680e1, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x808074ff, 0x750fe534, 0xaea408f0, 0x74c3fbf0, 0x74ff9b70, 
    0xe5228081, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x80c074ff, 0x750fe510, 0xaea408f0, 0x74c3fbf0, 0x74ff9b70, 0x74fe9ec1, 
    0x9c100212, 0xf0750fe5, 0xf0aea408, 0x7074c3fb, 0x9ee4ff9b, 0x801374fe, 0x750fe56b, 0xaea408f0, 0x74c3fbf0, 0x74ff9b70, 
    0x74fe9e01, 0xe5558013, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x9e4074ff, 0x801574fe, 0x750fe53f, 0xaea408f0, 0x74c3fbf0, 
    0x74ff9b70, 0x74fe9ec0, 0xe5298014, 0x08f0750f, 0xfbf0aea4, 0x9b7074c3, 0x9e8074ff, 0x801474fe, 0x750fe513, 0xaea408f0, 
    0x74c3fbf0, 0xe4ff9b70, 0x1574fe9e, 0xe4fd0094, 0x0b8f0094, 0x098d0a8e, 0x0be508f5, 0xe4ff0424, 0xe4fe0a35, 0xe4fd0935, 
    0x7bfc0835, 0x79c87a01, 0x3b1112f5, 0xe09533ef, 0x90fcfdfe, 0x0812fdc8, 0xfdc89098, 0xa3a3fce0, 0xecffe0a3, 0x22015033, 
    0xa3f5c890, 0x54e0a3a3, 0x8fe4ff01, 0xae0baf0c, 0xac09ad0a, 0x7a017b08, 0x12f979c8, 0xc8903b11, 0xa3fce0f9, 0xe0a3fde0, 
    0xffe0a3fe, 0x07121e78, 0x0354efe3, 0xe50d8fff, 0xe50c600c, 0x7f04600d, 0x7f068000, 0x7f028001, 0xf2c89000, 0xe0a3fbe0, 
    0xf9e0a3fa, 0x740612ef, 0x9022007f, 0x08121ac9, 0x1ec99098, 0xeaa3f0eb, 0xf0e9a3f0, 0xf0e874a3, 0xf0ff74a3, 0x12f0a3e4, 
    0x0000d508, 0xf0900000, 0xf0117400, 0xf00174a3, 0xa31ac990, 0xffe0a3a3, 0xef04f090, 0x1ac990f0, 0xe0a3fce0, 0xfee0a3fd, 
    0x78ffe0a3, 0xe3071208, 0xef05f090, 0x1ac990f0, 0xe0a3fce0, 0xfee0a3fd, 0x78ffe0a3, 0xe3071210, 0xef06f090, 0x1ac990f0, 
    0xe0a3fce0, 0xfee0a3fd, 0x78ffe0a3, 0xe3071218, 0xef07f090, 0x21c990f0, 0x60f014e0, 0x02f09015, 0x23c990e0, 0x30ffe0f0, 
    0x0e54ebe0, 0xc9900470, 0xc990f022, 0xc990e022, 0x0203601e, 0xfbe00413, 0xa3fae0a3, 0x03c0f9e0, 0x01c002c0, 0x90430812, 
    0xffe008f0, 0xfefdfce4, 0xeeff2feb, 0x39edfe3a, 0xfc38ecfd, 0x02d001d0, 0x081203d0, 0x1ec99029, 0xe0a3fbe0, 0xf9e0a3fa, 
    0x02c003c0, 0x081201c0, 0xc004c009, 0xc006c005, 0x09f09007, 0xfce4ffe0, 0x0878fefd, 0xa8f60712, 0xaa05a904, 0xd007ab06, 
    0xd006d007, 0xef04d005, 0x3aeeff2b, 0xfd39edfe, 0xd0fc38ec, 0xd002d001, 0x29081203, 0xe01ec990, 0xfae0a3fb, 0xc0f9e0a3, 
    0xc002c003, 0x09081201, 0x05c004c0, 0x07c006c0, 0xe00af090, 0xfdfce4ff, 0x121078fe, 0x04a8f607, 0x06aa05a9, 0x07d007ab, 
    0x05d006d0, 0x2bef04d0, 0xfe3aeeff, 0xecfd39ed, 0x01d0fc38, 0x03d002d0, 0x90290812, 0xfbe01ec9, 0xa3fae0a3, 0x03c0f9e0, 
    0x01c002c0, 0xc0090812, 0xc005c004, 0x9007c006, 0xffe00bf0, 0xfefdfce4, 0x07121878, 0xa904a8f6, 0xab06aa05, 0xd007d007, 
    0xd005d006, 0xff2bef04, 0xedfe3aee, 0x38ecfd39, 0xd001d0fc, 0x1203d002, 0x0f802908, 0xe0a3fbe0, 0xf9e0a3fa, 0xded50812, 
    0x90efbead, 0xffe022c9, 0x08f5e422, 0x0194c3ef, 0x007f0340, 0x94c3ef22, 0x90495008, 0x83c000f2, 0xfee082c0, 0x07a80174, 
    0xc3028008, 0xf4fcd833, 0x82d05efd, 0x90f083d0, 0xf0e401f2, 0xf0a3f0a3, 0xf05de0a3, 0xf0ff74a3, 0xf0a3f0a3, 0xe000f290, 
    0x07a808f5, 0xc3028008, 0x30fcd813, 0xff7f03e0, 0x22007f22, 0x0894c3ef, 0x94ef5540, 0x90505010, 0xf0e400f2, 0xc083c0a3, 
    0xeffee082, 0x74fdf824, 0x0805a801, 0x33c30280, 0xfcf4fcd8, 0xd082d05e, 0xf290f083, 0xa3f0e402, 0xff74a3f0, 0x5ce0a3f0, 
    0xff74a3f0, 0x90f0a3f0, 0xf5e001f2, 0x0805a808, 0x13c30280, 0xe030fcd8, 0x22ff7f03, 0xef22007f, 0x401094c3, 0x1894ef55, 
    0xf2905050, 0xa3f0e400, 0x83c0a3f0, 0xfee082c0, 0xfdf024ef, 0x05a80174, 0xc3028008, 0xf4fcd833, 0x82d05efc, 0x90f083d0, 
    0xf0e403f2, 0xf0ff74a3, 0xe0a3f0a3, 0x74a3f05c, 0xf290f0ff, 0x08f5e002, 0x800805a8, 0xd813c302, 0x03e030fc, 0x7f22ff7f, 
    0xc3ef2200, 0x52401894, 0x502094ef, 0x00f2904d, 0xf0a3f0e4, 0xc0a3f0a3, 0xe082c083, 0xe824effe, 0xa80174fd, 0x02800805, 
    0xfcd833c3, 0xd05efcf4, 0xf083d082, 0x7404f290, 0xf0a3f0ff, 0xe0a3f0a3, 0xf290f05c, 0x08f5e003, 0x800805a8, 0xd813c302, 
    0x03e030fc, 0x7f22ff7f, 0x007f2200, 0xe407ab22, 0x14f515f5, 0x12f513f5, 0x24e4feef, 0x34eeff4c, 0x8fe4fe20, 0xf5148e15, 
    0x9012f513, 0xa3a318c9, 0x85ffe0a3, 0x14858215, 0x90f0ef83, 0xfce018c9, 0xa3fde0a3, 0xe0a3fee0, 0x120878ff, 0x14aae307, 
    0x828b15ab, 0xefa3838a, 0x18c990f0, 0xe0a3fce0, 0xfee0a3fd, 0x78ffe0a3, 0xe3071210, 0x838a828b, 0xf0efa3a3, 0xe018c990, 
    0xfde0a3fc, 0xa3fee0a3, 0x1878ffe0, 0x8be30712, 0xa3838a82, 0xf0efa3a3, 0xa31cc990, 0xffe0a3a3, 0xf52b0474, 0xf53ae482, 
    0x90f0ef83, 0xfce01cc9, 0xa3fde0a3, 0xe0a3fee0, 0x120878ff, 0x0574e307, 0xe482f52b, 0xef83f53a, 0x1cc990f0, 0xe0a3fce0, 
    0xfee0a3fd, 0x78ffe0a3, 0xe3071210, 0xf52b0674, 0xf53ae482, 0x90f0ef83, 0xfce01cc9, 0xa3fde0a3, 0xe0a3fee0, 0x121878ff, 
    0x0774e307, 0xe482f52b, 0xef83f53a, 0x20c990f0, 0xe0a3a3a3, 0x2b0874ff, 0x3ae482f5, 0xf0ef83f5, 0xe020c990, 0xfde0a3fc, 
    0xa3fee0a3, 0x0878ffe0, 0x74e30712, 0x82f52b09, 0x83f53ae4, 0xc990f0ef, 0xa3fce020, 0xe0a3fde0, 0xffe0a3fe, 0x07121078, 
    0x2b0a74e3, 0x3ae482f5, 0xf0ef83f5, 0xe020c990, 0xfde0a3fc, 0xa3fee0a3, 0x1878ffe0, 0x74e30712, 0xf515250b, 0x1435e482, 
    0xf0ef83f5, 0x9022007f, 0xf0ed12c9, 0xef11c990, 0xf5e4fbf0, 0xf50af50b, 0xf508f509, 0xf50ef50f, 0xeb0cf50d, 0x502094c3, 
    0x580f7565, 0x759f0e75, 0x0c75540d, 0xae0faf00, 0xac0dad0e, 0x7a007b0c, 0x12087900, 0x33ef3b11, 0xfdfee095, 0x13c990fc, 
    0x90980812, 0xfce013c9, 0xe0a3a3a3, 0x5033ecff, 0xc9902201, 0xc990e012, 0xe0116024, 0xfde0a3fc, 0xa3fee0a3, 0xc990ffe0, 
    0x6580e011, 0xe0a3fce0, 0xfee0a3fd, 0x90ffe0a3, 0x02e011c9, 0x0f75ed16, 0x9f0e755c, 0x75540d75, 0x0faf000c, 0x0dad0eae, 
    0x007b0cac, 0x0879007a, 0xef3b1112, 0xfee09533, 0xc990fcfd, 0x98081213, 0xe013c990, 0xa3a3a3fc, 0x33ecffe0, 0x90220150, 
    0x90e012c9, 0x2c6024c9, 0xe0a3fce0, 0xfee0a3fd, 0x90ffe0a3, 0x24e011c9, 0x12f8f9e0, 0x0be5f607, 0xe50bf54f, 0x0af54e0a, 
    0xf54d09e5, 0x4c08e509, 0x2d8008f5, 0xe0a3fce0, 0xfee0a3fd, 0x90ffe0a3, 0x24e011c9, 0x12f8f9e0, 0x0712f607, 0x5f0be5c5, 
    0x0ae50bf5, 0xe50af55e, 0x09f55d09, 0xf55c08e5, 0xae0baf08, 0xac09ad0a, 0x1bc99008, 0xaf980812, 0xad0eae0f, 0x120cac0d, 
    0x33ef3d1d, 0xfdfee095, 0x13c990fc, 0x90980812, 0xfce013c9, 0xe0a3a3a3, 0x5033ecff, 0x007f2201, 0xf0c89022, 0xa3e4f0ef, 
    0x0812a3f0, 0x220000a4, 0x307fe460, 0xfcfd757e, 0xe036c990, 0xf9e0a3f8, 0xa3fae0a3, 0x12d3fbe0, 0x0a40d207, 0x1236c990, 
    0x0000a408, 0xc8900100, 0x12ffe0f0, 0xc890f319, 0x90f0eff1, 0xf4e0f1c8, 0x74a33a70, 0x650812ff, 0x4f4e4dec, 0xc9902e60, 
    0xa3fce036, 0xe0a3fde0, 0x24e0a3fe, 0x3ee4ff01, 0xfd3de4fe, 0x90fc3ce4, 0x081236c9, 0xf0c89098, 0x1912ffe0, 0xf1c890f3, 
    0xbf70f0ef, 0xe0f1c890, 0x9022ffb4, 0xfce03ac9, 0xa3fde0a3, 0xe0a3fee0, 0xe4ff0124, 0x3de4fe3e, 0xfc3ce4fd, 0x123ac990, 
    0xff7f9808, 0x36c99022, 0xe0a3a3a3, 0x101890ff, 0xc990f0ef, 0xa3fce036, 0xe0a3fde0, 0xffe0a3fe, 0x07120878, 0x111890e3, 
    0xc990f0ef, 0xa3fce036, 0xe0a3fde0, 0xffe0a3fe, 0x07121078, 0x121890e3, 0xc990f0ef, 0xa3fce036, 0xe0a3fde0, 0xffe0a3fe, 
    0x07121878, 0x131890e3, 0xc990f0ef, 0xa3a3a33a, 0x1890ffe0, 0x90f0ef1c, 0xfce03ac9, 0xa3fde0a3, 0xe0a3fee0, 0x120878ff, 
    0x1890e307, 0x90f0ef1d, 0xfce03ac9, 0xa3fde0a3, 0xe0a3fee0, 0x121078ff, 0x1890e307, 0x90f0ef1e, 0xfce03ac9, 0xa3fde0a3, 
    0xe0a3fee0, 0x121878ff, 0x1890e307, 0x7ff0ef1f, 0xc8902200, 0xe4f0eff0, 0x12a3f0a3, 0x0000a408, 0x7fe46022, 0xfd757e30, 
    0x2ec990fc, 0xe0a3f8e0, 0xfae0a3f9, 0xd3fbe0a3, 0x40d20712, 0x2ec9900a, 0x00a40812, 0x90010000, 0xffe0f0c8, 0x90191312, 
    0xf0eff1c8, 0xe0f1c890, 0xa33a70f4, 0x0812ff74, 0x4e4dec65, 0x902e604f, 0xfce02ec9, 0xa3fde0a3, 0xe0a3fee0, 0xe4ff0124, 
    0x3de4fe3e, 0xfc3ce4fd, 0x122ec990, 0xc8909808, 0x12ffe0f0, 0xc8901913, 0x70f0eff1, 0xf1c890bf, 0x22ffb4e0, 0xe032c990, 
    0xfde0a3fc, 0xa3fee0a3, 0xff0124e0, 0xe4fe3ee4, 0x3ce4fd3d, 0x32c990fc, 0x7f980812, 0xc99022ff, 0xa3a3a32e, 0x1890ffe0, 
    0x90f0ef20, 0xfce02ec9, 0xa3fde0a3, 0xe0a3fee0, 0x120878ff, 0x1890e307, 0x90f0ef21, 0xfce02ec9, 0xa3fde0a3, 0xe0a3fee0, 
    0x121078ff, 0x1890e307, 0x90f0ef22, 0xfce02ec9, 0xa3fde0a3, 0xe0a3fee0, 0x121878ff, 0x1890e307, 0x90f0ef23, 0xa3a332c9, 
    0x90ffe0a3, 0xf0ef2418, 0xe032c990, 0xfde0a3fc, 0xa3fee0a3, 0x0878ffe0, 0x90e30712, 0xf0ef2518, 0xe032c990, 0xfde0a3fc, 
    0xa3fee0a3, 0x1078ffe0, 0x90e30712, 0xf0ef2618, 0xe032c990, 0xfde0a3fc, 0xa3fee0a3, 0x1878ffe0, 0x90e30712, 0xf0ef2718, 
    0xe422007f, 0xc3ef08f5, 0x03400194, 0xef22007f, 0x500894c3, 0xa8017440, 0x02800807, 0xfcd833c3, 0x00f290fe, 0xf0e4a3f0, 
    0xf0a3f0a3, 0xeefde0a3, 0x5eedfef4, 0xff74a3f0, 0xa3f0a3f0, 0x00f290f0, 0xa808f5e0, 0x02800807, 0xfcd813c3, 0x7f03e030, 
    0xff7f2200, 0x94c3ef22, 0xef4e4008, 0x49501094, 0xe400f290, 0xf824eff0, 0xa80174fe, 0x02800806, 0xfcd833c3, 0x01f290fd, 
    0xf0e4a3f0, 0x74a3f0a3, 0xe0a3f0ff, 0xfdf4edfc, 0xa3f05dec, 0xa3f0ff74, 0x01f290f0, 0xa808f5e0, 0x02800806, 0xfcd813c3, 
    0x7f03e030, 0xff7f2200, 0x94c3ef22, 0xef4e4010, 0x49501894, 0xe400f290, 0xeff0a3f0, 0x74fef024, 0x0806a801, 0x33c30280, 
    0x90fdfcd8, 0xa3f002f2, 0x74a3f0e4, 0xf0a3f0ff, 0xedfce0a3, 0x5decfdf4, 0xff74a3f0, 0x02f290f0, 0xa808f5e0, 0x02800806, 
    0xfcd813c3, 0x7f03e030, 0xff7f2200, 0x94c3ef22, 0xef4b4018, 0x46502094, 0xe400f290, 0xa3f0a3f0, 0xe824eff0, 0xa80174fe, 
    0x02800806, 0xfcd833c3, 0x03f290fd, 0xff74a3f0, 0xa3f0a3f0, 0xfce0a3f0, 0xecfdf4ed, 0xf290f05d, 0x08f5e003, 0x800806a8, 
    0xd813c302, 0x03e030fc, 0x7f22007f, 0x007f22ff, 0x11c99022, 0x07abf0ed, 0xf50bf5e4, 0xf509f50a, 0xf50ff508, 0xf50df50e, 
    0xebf0a30c, 0x3f541313, 0x0354ebf0, 0xfdfce4ff, 0x7bff74fe, 0xf8f9faf0, 0xefa80612, 0xeefb7424, 0xedfa1134, 0xe4f9e434, 
    0xc990f83c, 0xe4ffe012, 0xebfefdfc, 0x3aeeff2f, 0xfd39edfe, 0x0b8f38ec, 0x098d0a8e, 0x7bfc08f5, 0x79007a00, 0x3b11120c, 
    0xe09533ef, 0x90fcfdfe, 0x081213c9, 0x13c99098, 0xa3a3fce0, 0xecffe0a3, 0x22015033, 0xe011c990, 0x6024c990, 0xa3fce026, 
    0xe0a3fde0, 0xffe0a3fe, 0x07120778, 0x4f0fe5f6, 0x0ee50ff5, 0xe50ef54e, 0x0df54d0d, 0xf54c0ce5, 0xe027800c, 0xfde0a3fc, 
    0xa3fee0a3, 0x0778ffe0, 0x12f60712, 0x0fe5c507, 0xe50ff55f, 0x0ef55e0e, 0xf55d0de5, 0x5c0ce50d, 0x0faf0cf5, 0x0dad0eae, 
    0xc9900cac, 0x9808121b, 0x0aae0baf, 0x08ac09ad, 0xef3d1d12, 0xfee09533, 0xc990fcfd, 0x98081213, 0xe013c990, 0xa3a3a3fc, 
    0x33ecffe0, 0x7f220150, 0xc8902200, 0xe4f0eff0, 0x0af50bf5, 0x08f509f5, 0x75e00cf5, 0x24a410f0, 0xf0e5ff00, 0xe4fe0434, 
    0x0a8e0b8f, 0x08f509f5, 0x838e828f, 0x740612e0, 0x0baf0aae, 0x838e828f, 0x0090e0a3, 0x86061201, 0x838e828f, 0x90e0a3a3, 
    0x06120200, 0xaf0aae86, 0x8e828f0b, 0xa3a3a383, 0x030090e0, 0x74860612, 0x82f52f04, 0x83f53ee4, 0x040090e0, 0xae860612, 
    0x740baf0a, 0x82f52f05, 0x83f53ee4, 0x050090e0, 0x74860612, 0x82f52f06, 0x83f53ee4, 0x060090e0, 0xae860612, 0x740baf0a, 
    0x82f52f07, 0x83f53ee4, 0x070090e0, 0x74860612, 0x82f52f08, 0x83f53ee4, 0x080090e0, 0xae860612, 0x740baf0a, 0x82f52f09, 
    0x83f53ee4, 0x090090e0, 0x74860612, 0x82f52f0a, 0x83f53ee4, 0x0a0090e0, 0x74860612, 0xf50b250b, 0x0a35e482, 0x90e083f5, 
    0x06020b00, 0x17c99086, 0x79980812, 0xe4ff7be8, 0x00f090fa, 0xa3f01074, 0x90f00174, 0xa3a317c9, 0x90ffe0a3, 0xf0ef04f0, 
    0xe017c990, 0xfde0a3fc, 0xa3fee0a3, 0x0878ffe0, 0x90e30712, 0xf0ef05f0, 0xe017c990, 0xfde0a3fc, 0xa3fee0a3, 0x1078ffe0, 
    0x90e30712, 0xf0ef06f0, 0xe017c990, 0xfde0a3fc, 0xa3fee0a3, 0x1878ffe0, 0x90e30712, 0xf0ef07f0, 0xa31bc990, 0xffe0a3a3, 
    0xef08f090, 0x1bc990f0, 0xe0a3fce0, 0xfee0a3fd, 0x78ffe0a3, 0xe3071208, 0xef09f090, 0x1bc990f0, 0xe0a3fce0, 0xfee0a3fd, 
    0x78ffe0a3, 0xe3071210, 0xef0af090, 0x1bc990f0, 0xe0a3fce0, 0xfee0a3fd, 0x78ffe0a3, 0xe3071218, 0xef0bf090, 0x60e919f0, 
    0x02f0900d, 0xe030fae0, 0x700e54f4, 0x03affb01, 0x11c99022, 0xeba3f0ef, 0xf0eaa3f0, 0xe4f0e9a3, 0x0af50bf5, 0x08f509f5, 
    0x0ef50ff5, 0x0cf50df5, 0xc990f0a3, 0x13ffe011, 0x903f5413, 0xeff015c9, 0xeaff0354, 0x0f604b49, 0xe012c990, 0xfae0a3fb, 
    0xe4f9e0a3, 0xe4740612, 0x74fefdfc, 0xfaf07bff, 0x0612f8f9, 0x7424efa8, 0x1134eefb, 0xe434edfa, 0xf83ce4f9, 0xe015c990, 
    0xfdfce4ff, 0xff2febfe, 0xedfe3aee, 0x38ecfd39, 0x0a8e0b8f, 0x08f5098d, 0x7a007bfc, 0x120c7900, 0x33ef3b11, 0xfdfee095, 
    0x16c990fc, 0x90980812, 0xfce016c9, 0xe0a3a3a3, 0x5033ecff, 0xc9902201, 0xa3fbe012, 0xe0a3fae0, 0x4b49eaf9, 0x0faf1560, 
    0x0dad0eae, 0x07780cac, 0xefe30712, 0xefff0154, 0x7f740612, 0xe0c02200, 0x83c0f0c0, 0xd0c082c0, 0xc000d075, 0xc001c000, 
    0xc003c002, 0xc005c004, 0x7507c006, 0x8a755d8c, 0x327be43e, 0x90f8f9fa, 0xfce042c9, 0xa3fde0a3, 0xe0a3fee0, 0x330712ff, 
    0x01ad00ac, 0x03af02ae, 0xf9fafbe4, 0x0712c3f8, 0x900570d2, 0xf00447c9, 0x7ee87fe4, 0x90fcfd03, 0xf8e042c9, 0xa3f9e0a3, 
    0xe0a3fae0, 0x0712c3fb, 0x900a70d2, 0x081242c9, 0x000000a4, 0x42c99000, 0xe0a3fce0, 0xfee0a3fd, 0x0124e0a3, 0xfe3ee4ff, 
    0xe4fd3de4, 0xc990fc3c, 0x98081242, 0x06d007d0, 0x04d005d0, 0x02d003d0, 0x00d001d0, 0x82d0d0d0, 0xf0d083d0, 0x9032e0d0, 
    0xf0eff0c8, 0xaaf0eba3, 0x0812a305, 0x000000a4, 0xfd24ea00, 0x02241060, 0xc8907870, 0xa40812f2, 0x10000000, 0xc8900a80, 
    0xa40812f2, 0x00000000, 0xe0f2c890, 0xf9e0a3f8, 0xa3fae0a3, 0xc890fbe0, 0xe4fee0f0, 0xeeff0024, 0xe4fe2034, 0x2febfdfc, 
    0xfe3eeaff, 0xecfd39ed, 0xc890fc38, 0x980812f2, 0xe0f1c890, 0xa3a3a3fb, 0xe0a3fee0, 0x838e82f5, 0xc890f0eb, 0xe0a3a3f2, 
    0xffe0a3fe, 0x838e82f5, 0x8ff0e4a3, 0xa3838e82, 0x828ff0a3, 0xa3a3838e, 0x7822f0a3, 0xd8f6e47f, 0x158175fd, 0x026a2002, 
    0x93e49422, 0x93e4f8a3, 0xf60340a3, 0x08f20180, 0x2980f4df, 0xf8a393e4, 0x0c240754, 0xc433c3c8, 0x20440f54, 0x044083c8, 
    0x018056f4, 0xe4dff646, 0x02010b80, 0x20100804, 0x22908040, 0x017ee417, 0xa3bc6093, 0x303f54ff, 0x1f5409e5, 0xa393e4fe, 
    0xcf0e0160, 0xe025c054, 0xb840a860, 0xfaa393e4, 0xf8a393e4, 0xc8a393e4, 0xcac882c5, 0xf0ca83c5, 0x82c5c8a3, 0x83c5cac8, 
    0xdee9dfca, 0x80be80e7, 0xfeffe47c, 0xc990fcfd, 0xa3f8e011, 0xe0a3f9e0, 0xfbe0a3fa, 0xd20712d3, 0xc9906c40, 0xa4081215, 
    0x70030000, 0xfdfeffe4, 0x15c990fc, 0xe0a3f8e0, 0xfae0a3f9, 0xd3fbe0a3, 0x40d20712, 0x15c99024, 0xe0a3fce0, 0xfee0a3fd, 
    0xff24e0a3, 0xff34eeff, 0xff34edfe, 0xff34ecfd, 0x15c990fc, 0x80980812, 0x11c990c3, 0xe0a3fce0, 0xfee0a3fd, 0xff24e0a3, 
    0xff34eeff, 0xff34edfe, 0xff34ecfd, 0x11c990fc, 0x02980812, 0x9022b120, 0xf0eff0c8, 0xf508f5e4, 0xf50af509, 0x54ffe00b, 
    0xefc3fd03, 0x94e4ff9d, 0x2fe4fe00, 0x087482f5, 0xe083f53e, 0x017408f5, 0x7482f52f, 0x83f53e08, 0x9009f5e0, 0xffe0f0c8, 
    0xc3fd0354, 0xe4ff9def, 0x74fe0094, 0x82f52f02, 0xf53e0874, 0x0af5e083, 0xf52f0374, 0x3e087482, 0xf5e083f5, 0xf0c8900b, 
    0x140354e0, 0x60140e60, 0x1060140f, 0x11700324, 0x0a8008e5, 0x068009e5, 0x02800ae5, 0x06120be5, 0x07ad2274, 0xf512f5e4, 
    0x94c3ed13, 0xed064018, 0x402794d3, 0x1313ed0b, 0xe0253f54, 0x168012f5, 0xffe824ed, 0xfeff34e4, 0xce0278ef, 0x13ce13c3, 
    0x0c24f9d8, 0x05af12f5, 0x541313ef, 0xea13f53f, 0x05604b49, 0x061212e5, 0x1bc99074, 0xe0a3fbe0, 0xf9e0a3fa, 0x604b49ea, 
    0x1213e505, 0x44227406, 0x000042c9, 0xc9440000, 0x00000049, 0x47c94100, 0x48c94100, 0x46c94100, 0x24c94400, 0x01000000, 
    0x003ec944, 0x42070000, 0x010028c9, 0x002ac944, 0x44102700, 0x000036c9, 0xc9440100, 0x0000002e, 0x3ac94401, 0x00000000, 
    0x0032c944, 0x00000000, 0x75018975, 0x8a755d8c, 0xd2afd23e, 0x228cd2a9, 0x74000090, 0x74a3f003, 0xe4a3f001, 0x22f0a3f0, 
    0x9008f5e4, 0xf5e00400, 0x74060208, 0x12682212, 0x00127822, 0x00fb800e, 
};

int32
sys_usw_mcu_chip_read(uint8 lchip, uint32 offset, uint32* p_value)
{
    if (1 == SDK_WORK_PLATFORM)
    {
        return 0;
    }

    if (DRV_IS_TMM(lchip) || DRV_IS_AT(lchip))
    {
        return CTC_E_NONE;
    }

    CTC_ERROR_RETURN(drv_usw_chip_read(lchip, offset, p_value));

    return CTC_E_NONE;
}

int32
sys_usw_mcu_chip_write(uint8 lchip, uint32 offset, uint32 value)
{
    if (1 == SDK_WORK_PLATFORM)
    {
        return 0;
    }

    if (DRV_IS_TMM(lchip) || DRV_IS_AT(lchip))
    {
        return CTC_E_NONE;
    }

    LCHIP_CHECK(lchip);
    CTC_ERROR_RETURN(drv_usw_chip_write(lchip, offset, value));

    return CTC_E_NONE;
}


int32
sys_usw_mac_set_mcu_enable(uint8 lchip, uint32 enable)
{
    uint32 en = 0;
    LCHIP_CHECK(lchip);
    en = enable ? 1 : 0;
    CTC_ERROR_RETURN(sys_usw_mcu_chip_write(lchip, SYS_USW_MCU_GLB_ON_BASE_ADDR, en));

    return CTC_E_NONE;
}

int32
sys_usw_mac_get_mcu_enable(uint8 lchip, uint32* enable)
{
    uint8 core_id;
    uint8 mcu_max_num = 0;
    uint32 value = 0;
    uint32 mcu_switch_stat_addr[SYS_TSINGMA_MCU_MAX_NUM] = {0};

    LCHIP_CHECK(lchip);

    if(DRV_IS_TSINGMA(lchip))
    {
        mcu_max_num = SYS_TSINGMA_MCU_MAX_NUM;
        mcu_switch_stat_addr[0] = SYS_TSINGMA_MCU_0_SWITCH_STAT_ADDR;
        mcu_switch_stat_addr[1] = SYS_TSINGMA_MCU_1_SWITCH_STAT_ADDR;
        mcu_switch_stat_addr[2] = SYS_TSINGMA_MCU_2_SWITCH_STAT_ADDR;
        mcu_switch_stat_addr[3] = SYS_TSINGMA_MCU_3_SWITCH_STAT_ADDR;
    }
    else
    {
        mcu_max_num = 1;
        mcu_switch_stat_addr[0] = SYS_USW_MCU_GLB_ON_BASE_ADDR;
    }
    
    for(core_id = 0; core_id < mcu_max_num; core_id++)
    {
        CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, mcu_switch_stat_addr[core_id], &value));
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "MCU %u is %s.\n", core_id, (value ? "running" : "stop"));
    }
    
    *enable = (uint32)(value & 0xff);
    
    return CTC_E_NONE;
}

int32
sys_usw_mac_set_mcu_port_enable(uint8 lchip, uint32 gport, uint32 enable)
{
    uint32 tmp_val32 = 0;
    uint16 lport = 0;
    sys_datapath_lport_attr_t* port_attr = NULL;

    SYS_CONDITION_RETURN((!DRV_IS_DUET2(lchip)), CTC_E_NONE);

    LCHIP_CHECK(lchip);
    lport = CTC_MAP_GPORT_TO_LPORT(gport);
    SYS_MAP_CTC_GPORT_TO_DRV_LPORT_WITH_CHECK(gport, lchip, lport);
    CTC_ERROR_RETURN(sys_usw_mac_get_port_capability(lchip, lport, &port_attr));
    CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, SYS_USW_MCU_PORT_ON_BASE_ADDR+port_attr->mac_id/4*4, &tmp_val32));
    if (enable)
    {
        tmp_val32 |= (1 << 8*(port_attr->mac_id%4));
    }
    else
    {
        tmp_val32 &= ~(1 << 8*(port_attr->mac_id%4));
    }
    CTC_ERROR_RETURN(sys_usw_mcu_chip_write(lchip, SYS_USW_MCU_PORT_ON_BASE_ADDR+port_attr->mac_id/4*4, tmp_val32));

    return CTC_E_NONE;
}

int32
sys_usw_mac_get_mcu_port_enable(uint8 lchip, uint32 gport, uint32* enable)
{
    uint32 tmp_val32 = 0;
    uint16 lport = 0;
    sys_datapath_lport_attr_t* port_attr = NULL;

    SYS_CONDITION_RETURN((!DRV_IS_DUET2(lchip)), CTC_E_NONE);

    LCHIP_CHECK(lchip);
    lport = CTC_MAP_GPORT_TO_LPORT(gport);
    SYS_MAP_CTC_GPORT_TO_DRV_LPORT_WITH_CHECK(gport, lchip, lport);
    CTC_ERROR_RETURN(sys_usw_mac_get_port_capability(lchip, lport, &port_attr));
    
    CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, SYS_USW_MCU_PORT_ON_BASE_ADDR+port_attr->mac_id/4*4, &tmp_val32));
    *enable = (uint32)((tmp_val32 >> 8*(port_attr->mac_id%4)) & 0xff);

    return CTC_E_NONE;
}

uint8
_sys_usw_mcu_dmps_log_string_trans(uint8 log_evnet, uint8 event_type)
{
    if ((SYS_MCU_LOG_EVENT_0_AN_EN == log_evnet) && (SYS_MCU_LOG_EVENT_0_TYPE_DPORT == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_DPORT;
    }
    else if ((SYS_MCU_LOG_EVENT_2_LT_EN == log_evnet) && (SYS_MCU_LOG_EVENT_2_TYPE_FUNC_POS == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_FUNC_POS;
    }
    else if ((SYS_MCU_LOG_EVENT_1_AN_DIS == log_evnet) && (SYS_MCU_LOG_EVENT_1_TYPE_DPORT == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_DPORT;
    }
    else if ((SYS_MCU_LOG_EVENT_1_AN_DIS == log_evnet) && (SYS_MCU_LOG_EVENT_1_TYPE_SERDES_SPEED == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_SERDES_SPEED;
    }
    else if ((SYS_MCU_LOG_EVENT_3_AN_GOOD_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_3_TYPE_PSD == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PSD;
    }
    else if ((SYS_MCU_LOG_EVENT_6_LT_GOOD_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_6_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_6_LT_GOOD_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_6_TYPE_PCS_LANE_BMP == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PCS_LANE_BMP;
    }
    else if ((SYS_MCU_LOG_EVENT_6_LT_GOOD_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_6_TYPE_LT_DONE_BMP == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_LT_DONE_BMP;
    }
    else if ((SYS_MCU_LOG_EVENT_7_AN_OK == log_evnet) && (SYS_MCU_LOG_EVENT_7_TYPE_PSD == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PSD;
    }
    else if ((SYS_MCU_LOG_EVENT_8_ANLT_OK == log_evnet) && (SYS_MCU_LOG_EVENT_8_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_9_RESATRT_AN_START == log_evnet) && (SYS_MCU_LOG_EVENT_9_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_11_AN_TMIEOUT == log_evnet) && (SYS_MCU_LOG_EVENT_11_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_12_LT_TMIEOUT == log_evnet) && (SYS_MCU_LOG_EVENT_12_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_13_SWITCH_SERDES == log_evnet) && (SYS_MCU_LOG_EVENT_13_TYPE_SERDES_SPEED == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_SERDES_SPEED;
    }
    else if ((SYS_MCU_LOG_EVENT_13_SWITCH_SERDES == log_evnet) && (SYS_MCU_LOG_EVENT_13_TYPE_FUNC_POS == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_FUNC_POS;
    }
    else if ((SYS_MCU_LOG_EVENT_16_RECV_ANLT_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_16_TYPE_PSD == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PSD;
    }
    else if ((SYS_MCU_LOG_EVENT_16_RECV_ANLT_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_16_TYPE_INTR_TYPE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INTR_TYPE;
    }
    else if ((SYS_MCU_LOG_EVENT_17_PROC_SYNC_MSG_START == log_evnet) && (SYS_MCU_LOG_EVENT_17_TYPE_MSG_TYPE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MSG_TYPE;
    }
    else if ((SYS_MCU_LOG_EVENT_19_PROC_ASYNC_MSG_START == log_evnet) && (SYS_MCU_LOG_EVENT_19_TYPE_MSG_TYPE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MSG_TYPE;
    }
    else if ((SYS_MCU_LOG_EVENT_23_GET_MAC_RX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_23_TYPE_MAC_GROUP_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MAC_GROUP_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_23_GET_MAC_RX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_23_TYPE_STATS_BLOCK_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_STATS_BLOCK_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_23_GET_MAC_RX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_23_TYPE_MAC_STAT_OP == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MAC_STAT_OP;
    }
    else if ((SYS_MCU_LOG_EVENT_25_GET_MAC_TX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_25_TYPE_MAC_GROUP_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MAC_GROUP_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_25_GET_MAC_TX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_25_TYPE_STATS_BLOCK_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_STATS_BLOCK_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_25_GET_MAC_TX_STATS_START == log_evnet) && (SYS_MCU_LOG_EVENT_25_TYPE_MAC_STAT_OP == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_MAC_STAT_OP;
    }
    else if ((SYS_MCU_LOG_EVENT_29_LINK_UP_TMIEOUT == log_evnet) && (SYS_MCU_LOG_EVENT_29_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_30_LINK_UP == log_evnet) && (SYS_MCU_LOG_EVENT_30_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_30_LINK_UP == log_evnet) && (SYS_MCU_LOG_EVENT_30_TYPE_PCS_STATUS == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PCS_STATUS;
    }
    else if ((SYS_MCU_LOG_EVENT_31_TIMER_EN == log_evnet) && (SYS_MCU_LOG_EVENT_31_TYPE_TIMER_EN == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_TIMER_EN;
    }
    else if ((SYS_MCU_LOG_EVENT_31_TIMER_EN == log_evnet) && (SYS_MCU_LOG_EVENT_31_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_32_SERDES_POLL_PIN_FAIL == log_evnet) && (SYS_MCU_LOG_EVENT_32_TYPE_PIN == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PIN;
    }
    else if ((SYS_MCU_LOG_EVENT_32_SERDES_POLL_PIN_FAIL == log_evnet) && (SYS_MCU_LOG_EVENT_32_TYPE_PIN_DATA == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PIN_DATA;
    }
    else if ((SYS_MCU_LOG_EVENT_32_SERDES_POLL_PIN_FAIL == log_evnet) && (SYS_MCU_LOG_EVENT_32_TYPE_EXP_VAL == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_EXP_VAL;
    }
    else if ((SYS_MCU_LOG_EVENT_33_LINK_DOWN == log_evnet) && (SYS_MCU_LOG_EVENT_33_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_33_LINK_DOWN == log_evnet) && (SYS_MCU_LOG_EVENT_33_TYPE_PCS_STATUS == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PCS_STATUS;
    }
    else if ((SYS_MCU_LOG_EVENT_34_RECV_RX_PAGE_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_34_TYPE_PSD == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PSD;
    }
    else if ((SYS_MCU_LOG_EVENT_34_RECV_RX_PAGE_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_34_TYPE_BASE_PAGE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_BASE_PAGE;
    }
    else if ((SYS_MCU_LOG_EVENT_34_RECV_RX_PAGE_INTR == log_evnet) && (SYS_MCU_LOG_EVENT_34_TYPE_NEXT_PAGE1 == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_NEXT_PAGE1;
    }
    else if ((SYS_MCU_LOG_EVENT_35_SYNC_AN_FEC == log_evnet) && (SYS_MCU_LOG_EVENT_35_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_36_GET_ANLT_STATE == log_evnet) && (SYS_MCU_LOG_EVENT_36_TYPE_INNER_ID == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID;
    }
    else if ((SYS_MCU_LOG_EVENT_37_AN_HCD == log_evnet) && (SYS_MCU_LOG_EVENT_37_TYPE_PSD == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_PSD;
    }
    else if ((SYS_MCU_LOG_EVENT_37_AN_HCD == log_evnet) && (SYS_MCU_LOG_EVENT_37_TYPE_IF_MODE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_IF_MODE;
    }
    else if ((SYS_MCU_LOG_EVENT_37_AN_HCD == log_evnet) && (SYS_MCU_LOG_EVENT_37_TYPE_FEC_MODE == event_type))
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_FEC_MODE;
    }    
    else
    {
        return SYS_MCU_LOG_EVENT_TYPE_STR_NONE;
    }

    return CTC_E_NONE;
}
int32
_sys_usw_mcu_dmps_msg_dump_log(uint8 lchip, uint8 mcu_id)
{ 
    int32  ret           = CTC_E_NONE;
    uint8  event         = 0;
    uint8  type_id       = 0;
    uint8  index         = 0;
    uint8  val_len       = 0;
    uint32 log_addr      = 0;
    uint32 ptr           = 0;
    uint32 idx           = 0;
    uint32 log_size      = 0;
    uint32 offset        = 0;
    uint8  log_type      = 0xff;
    uint32 event_code    = 0;
    uint32 ext_info_code = 0;
    uint8  ext_info_num  = 0;
    uint16 curret_tick   = 0;
    uint32 val32         = 0;
    uint32 val32_2       = 0;
    uint8* p_log         = NULL;
    sys_dmps_db_msg_handle_t* p_handle = NULL;
    char* log_evnet_str[SYS_MCU_LOG_EVENT_MAX] = 
    {
        "[ANLT]Enable  AN",                /* SYS_MCU_LOG_EVENT_0_AN_EN */
        "[ANLT]Disable AN",                /* SYS_MCU_LOG_EVENT_1_AN_DIS */
        "[ANLT]Enable  Link-Train",        /* SYS_MCU_LOG_EVENT_2_LT_EN */
        "[ANLT]Proc AN-GOOD Intr",         /* SYS_MCU_LOG_EVENT_3_AN_GOOD_INTR */
        "[ANLT]No HCD Cl73-Ability",       /* SYS_MCU_LOG_EVENT_4_AN_NO_HCD */
        "[ANLT]Lane Num NEQ",              /* SYS_MCU_LOG_EVENT_5_AN_LANE_NUM_NEQ */
        "[ANLT]Proc LT-GOOD Intr",         /* SYS_MCU_LOG_EVENT_6_LT_GOOD_INTR */
        "[ANLT]AN OK",                     /* SYS_MCU_LOG_EVENT_7_AN_OK */
        "[ANLT]ANLT OK",                   /* SYS_MCU_LOG_EVENT_8_ANLT_OK */
        "[ANLT]Restart AN Start",          /* SYS_MCU_LOG_EVENT_9_RESATRT_AN_START */
        "[ANLT]Restart AN End",            /* SYS_MCU_LOG_EVENT_10_RESATRT_AN_END */
        "[ANLT]AN timeout",                /* SYS_MCU_LOG_EVENT_11_AN_TMIEOUT */
        "[ANLT]LT timeout",                /* SYS_MCU_LOG_EVENT_12_LT_TMIEOUT */    
        "[ANLT]Switch SerDes",             /* SYS_MCU_LOG_EVENT_13_SWITCH_SERDES */
        "[ANLT]Req CPU DYN Port",          /* SYS_MCU_LOG_EVENT_14_REQ_CPU_DYN */
        "[ANLT]Req CPU release mac",       /* SYS_MCU_LOG_EVENT_15_REQ_CPU_RELEASE_MAC */
        "[ANLT]Recv ANLT Intr",            /* SYS_MCU_LOG_EVENT_16_RECV_ANLT_INTR */
        "[MSG]Proc Sync Msg Start",       /* SYS_MCU_LOG_EVENT_17_PROC_SYNC_MSG_START */
        "[MSG]Proc Sync Msg End",         /* SYS_MCU_LOG_EVENT_18_PROC_SYNC_MSG_END */
        "[MSG]Proc Async Msg Start",      /* SYS_MCU_LOG_EVENT_19_PROC_ASYNC_MSG_START */
        "[MSG]Proc Async Msg End",        /* SYS_MCU_LOG_EVENT_20_PROC_ASYNC_MSG_END */
        "[MSG]Proc Msg Start",            /* SYS_MCU_LOG_EVENT_21_RECV_MSG_START */
        "[MSG]Proc Msg End",              /* SYS_MCU_LOG_EVENT_22_RECV_MSG_END */
        "[STATS]Get Mac Rx Stats Start",    /* SYS_MCU_LOG_EVENT_23_GET_MAC_RX_STATS_START */
        "[STATS]Get Mac Rx Stats End",      /* SYS_MCU_LOG_EVENT_24_GET_MAC_RX_STATS_END */
        "[STATS]Get Mac Tx Stats Start",    /* SYS_MCU_LOG_EVENT_25_GET_MAC_TX_STATS_START */
        "[STATS]Get Mac Tx Stats End",      /* SYS_MCU_LOG_EVENT_26_GET_MAC_TX_STATS_END */
        "[STATS]Polling Mac Stats Start",   /* SYS_MCU_LOG_EVENT_27_POLL_MAC_STATS_START */
        "[STATS]Polling Mac Stats End",     /* SYS_MCU_LOG_EVENT_28_POLL_MAC_STATS_END */
        "[ANLT]Link Up timeout",           /* SYS_MCU_LOG_EVENT_29_LINK_UP_TMIEOUT */
        "[ANLT]Link Up",                   /* SYS_MCU_LOG_EVENT_30_LINK_UP */
        "[ANLT]Timer En",                  /* SYS_MCU_LOG_EVENT_31_TIMER_EN */
        "[ANLT]SerDes Poll Pin Fail",      /* SYS_MCU_LOG_EVENT_32_SERDES_POLL_PIN_FAIL */
        "[ANLT]Link Down",                 /* SYS_MCU_LOG_EVENT_33_LINK_DOWN */
        "[ANLT]Recv Rx Page Intr",         /* SYS_MCU_LOG_EVENT_34_RECV_RX_PAGE_INTR */
        "[ANLT]Sync AN FEC",               /* SYS_MCU_LOG_EVENT_35_SYNC_AN_FEC */
        "[ANLT]Get ANLT State",            /* SYS_MCU_LOG_EVENT_36_GET_ANLT_STATE */
        "[ANLT]Get AN HCD",                /* SYS_MCU_LOG_EVENT_37_AN_HCD */
    };
    char* log_type_str[SYS_MCU_LOG_EVENT_TYPE_STR_MAX] = 
    {
        "-",                         /* SYS_MCU_LOG_EVENT_TYPE_STR_NONE */
        "dport",                     /* SYS_MCU_LOG_EVENT_TYPE_STR_DPORT */
        "serdes_speed",              /* SYS_MCU_LOG_EVENT_TYPE_STR_SERDES_SPEED */
        "psd",                       /* SYS_MCU_LOG_EVENT_TYPE_STR_PSD */
        "inner_id",                  /* SYS_MCU_LOG_EVENT_TYPE_STR_INNER_ID */
        "pcs_lane_bmp",              /* SYS_MCU_LOG_EVENT_TYPE_STR_PCS_LANE_BMP */
        "lt_done_bmp",               /* SYS_MCU_LOG_EVENT_TYPE_STR_LT_DONE_BMP */
        "msg_type",                  /* SYS_MCU_LOG_EVENT_TYPE_STR_MSG_TYPE */
        "intr_type",                 /* SYS_MCU_LOG_EVENT_TYPE_STR_INTR_TYPE */
        "mac_group_id",              /* SYS_MCU_LOG_EVENT_TYPE_STR_MAC_GROUP_ID */
        "stats_block_id",            /* SYS_MCU_LOG_EVENT_TYPE_STR_STATS_BLOCK_ID */
        "mac_stat_op",               /* SYS_MCU_LOG_EVENT_TYPE_STR_MAC_STAT_OP */  
        "timer_en",                  /* SYS_MCU_LOG_EVENT_TYPE_STR_TIMER_EN */
        "func_pos",                  /* SYS_MCU_LOG_EVENT_TYPE_STR_FUNC_POS */
        "pin",                       /* SYS_MCU_LOG_EVENT_TYPE_STR_PIN */
        "pin_val",                   /* SYS_MCU_LOG_EVENT_TYPE_STR_PIN_DATA */
        "exp_val",                   /* SYS_MCU_LOG_EVENT_TYPE_STR_EXP_VAL */
        "pcs_status",                /* SYS_MCU_LOG_EVENT_TYPE_STR_PCS_STATUS */
        "base_page",                 /* SYS_MCU_LOG_EVENT_TYPE_STR_BASE_PAGE */
        "next_page1",                /* SYS_MCU_LOG_EVENT_TYPE_STR_NEXT_PAGE1*/
        "if_mode",                   /* SYS_MCU_LOG_EVENT_TYPE_STR_IF_MODE */
        "fec_mode",                  /* SYS_MCU_LOG_EVENT_TYPE_STR_FEC_MODE */
    };

    CTC_ERROR_RETURN(sys_usw_dmps_db_get_msg_handle(lchip, &p_handle));
    CTC_PTR_VALID_CHECK(p_handle);

    CTC_ERROR_RETURN(p_handle->read(lchip, mcu_id, MCU_GLB_INFO_DBG_LOG_PTR, 0x0, &ptr));
    CTC_ERROR_RETURN(p_handle->read(lchip, mcu_id, MCU_GLB_INFO_DBG_LOG_BASE_ADDR, 0x0, &log_addr));

    log_size = (ptr/4 + (ptr%4 != 0 ? 1:0))*sizeof(uint32);
    p_log = (uint8*)mem_malloc(MEM_DMPS_MODULE, log_size);

    /* read log */
    for (idx = 0; idx < log_size; idx += 4)
    {
        CTC_ERROR_GOTO(p_handle->read(lchip, mcu_id, log_addr + idx, 0x0, (uint32*)(p_log + idx)), ret, RELEASE_PTR_RETURN);
    }

    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "[MCU Type]\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0x0: C2M AN Enable         0x1: C2M AN Disable       0x2: C2M Restart AN             0x3: C2M AN FEC        0x4: C2M Dump DB\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0x5: C2M Get Mac Stats     0x6: C2M Clear Mac Stats  0x7: C2M Get ANLT State         0x8: C2M Link Up Intr  0x9: C2M Timer En\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0xa: C2M LInk Down         0xb: Link Adjust          0xc: M2C ANLT Status Sync       0xd: M2M ANLT Intr     0xe: M2M Restart AN Timer Intr \n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0xf: M2C Link Intr\n");

    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "[Intr Type]\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0x0: Lane 0 AN Complete    0x1: Lane 1 AN Complete   0x2: Lane 2 AN Complete         0x3: Lane 3 AN Complete\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "0x4: Lane 0 LT OK          0x5: Lane 1 LT OK         0x6: Lane 2 LT OK               0x7: Lane 3 LT OK      \n");

    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "[MCU Log]\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    %-12s %-32s %-24s | %-12s\n", "Tick", "Event", "TYPE ID", "VALUE");

    while(offset < ptr)
    {        
        log_type  = p_log[offset] & 0x1;
        if (log_type)
        {
            event_code = *(uint32*)(p_log + offset);

            ext_info_num = (uint8)((event_code >> 1) & 0x7f);
            event        = (uint8)((event_code >> 8) & 0xff);
            curret_tick  = (uint16)((event_code >> 16) & 0xffff);
            offset += 4;
        }
        else
        {
            ext_info_code = p_log[offset];

            type_id  = (uint8)((ext_info_code >> 1) & 0x7);
            val_len = (uint8)((ext_info_code >> 4) & 0xf);
            offset   += 1;

            if ((0xff == log_type) || (SYS_MCU_LOG_EVENT_MAX <= event))
            {
                continue;
            }

            val32   = *(uint32*)(p_log + offset);
            val32_2 = *(uint32*)(p_log + offset + 4);
            switch (val_len)
            {
                case 1:
                    val32 &= 0xff;
                    offset += 1;
                    break;
                case 2:
                    val32 &= 0xffff;
                    offset += 2;
                    break;
                case 4:
                    offset += 4;
                    break;
                case 8:
                    offset += 8;
                    break;
                default:
                    break;
            }

            index = _sys_usw_mcu_dmps_log_string_trans(event, type_id);
            if (val_len == 0)
            {
                SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    %-12d %-32s %-24s | %-12s\n", curret_tick, log_evnet_str[event], "-", "-");
            }
            else if (val_len == 8)
            {
                SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    %-12d %-32s %-24s | 0x%08x %08x\n", curret_tick, log_evnet_str[event], log_type_str[index], val32_2, val32);
            }
            else 
            {
                SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    %-12d %-32s %-24s | 0x%x\n", curret_tick, log_evnet_str[event], log_type_str[index], val32);
            }
        }

        if (ext_info_num == 0)
        {
            SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    %-12d %-32s %-24s | %-12s\n", curret_tick, log_evnet_str[event], "-", "-");
        }
    }

RELEASE_PTR_RETURN:
    mem_free(p_log);

    return ret;
}

int32
_sys_usw_mcu_dmps_msg_dump_buf_info(uint8 lchip, uint8 mcu_id)
{
    uint32 send_ptr = 0x0;
    uint32 recv_ptr = 0x0;
    uint32 priority = 0;
    uint32 log_ctl  = 0;
    sys_dmps_db_msg_handle_t* p_handle = NULL;
    CTC_ERROR_RETURN(sys_usw_dmps_db_get_msg_handle(lchip, &p_handle));
    CTC_PTR_VALID_CHECK(p_handle);

    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "[Buffer Info]\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    Sync Buffer Info :\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "sync_buf_addr", p_handle->sync_buf_addr);
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "sync_buf_len",  p_handle->sync_buf_len);

    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    Async Buffer Info :\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "priority_num", p_handle->priority_num);
    for (priority = 0; priority < p_handle->priority_num; priority ++)
    {
        p_handle->read(lchip, mcu_id, p_handle->p_c2m_buf[priority].send_ptr_addr, 0x0, &send_ptr);
        p_handle->read(lchip, mcu_id, p_handle->p_c2m_buf[priority].recv_ptr_addr, 0x0, &recv_ptr);

        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        [C2M@%d] send_ptr     : %u\n", priority, send_ptr);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        [C2M@%d] recv_ptr     : %u\n", priority, recv_ptr);
    }

    for (priority = 0; priority < p_handle->priority_num; priority ++)
    {
        p_handle->read(lchip, mcu_id, p_handle->p_m2c_buf[priority].send_ptr_addr, 0x0, &send_ptr);
        p_handle->read(lchip, mcu_id, p_handle->p_m2c_buf[priority].recv_ptr_addr, 0x0, &recv_ptr);
        
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        [M2C@%d] send_ptr     : %u\n", priority, send_ptr);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        [M2C@%d] recv_ptr     : %u\n", priority, recv_ptr);
    }

    p_handle->read(lchip, mcu_id, MCU_GLB_INFO_DBG_LOG_CTL, 0x0, &log_ctl);
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "    Log Buffer Info :\n");
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "log_addr", p_handle->log_addr);
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "log_len",  p_handle->log_len);
    SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP, "        %-20s : %u\n", "log_ctl",  log_ctl);

    return CTC_E_NONE;
}

uint32
_sys_usw_mcu_get_chip_mcu_num(uint8 lchip)
{
    uint32 mcu_num = 0;
    if(DRV_IS_DUET2(lchip))
    {
        mcu_num = 2;
    }
    else if(DRV_IS_TSINGMA(lchip))
    {
        mcu_num = 4;
    }
    else if(DRV_IS_TMM(lchip))
    {
        mcu_num = 7;
    }
    else if(DRV_IS_TMG(lchip))
    {
        mcu_num = 11;
    }
    else if(DRV_IS_AT(lchip))
    {
        ///TODO: subtype division
        mcu_num = 40;
    }
    return mcu_num;
}

int32
sys_usw_mac_show_mcu_debug_info(uint8 lchip, uint8 mcu_id)
{
    if(NULL == p_sys_mchip_master[lchip])
    {
        return CTC_E_INVALID_PTR;
    }
    if (1 == SDK_WORK_PLATFORM)
    {
        return 0;
    }
    if(MCHIP_DMPS(lchip)->mcu_show_debug_info)
    {
        (void)MCHIP_DMPS(lchip)->mcu_show_debug_info(lchip, mcu_id);
    }
    else return CTC_E_INVALID_PTR;

    if(!SYS_USW_DMPS_IS_OLD_DB(lchip))
    {
        (void)_sys_usw_mcu_dmps_msg_dump_log(lchip, mcu_id);
        (void)_sys_usw_mcu_dmps_msg_dump_buf_info(lchip, mcu_id);
    }
    
    return CTC_E_NONE;
}

int32
sys_usw_mac_show_mcu_version(uint8 lchip)
{
    uint32 mcu_version = 0;
    uint8 mcu_ver_major = 0;
    uint8 mcu_ver_minor = 0;
    sys_usw_dmps_mcu_fw_version_t mcu_ver;
    sys_usw_dmps_serdes_fw_version_t serdes_ver[2];
    

    if (DRV_IS_TMM(lchip))
    {
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    T.1d60a991\n");
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Date Code: 0x%02x\n", p_usw_datapath_master[lchip]->fw_header.date);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Hash Code: 0x%02x\n", p_usw_datapath_master[lchip]->fw_header.hash_code);
    }
    else if (DRV_IS_AT(lchip))
    {
        MCHIP_DMPS_CB(mcu_get_version, lchip, &mcu_ver);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    MCU version\n");
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Date   Code: %08x\n", mcu_ver.date);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Commit Code: %08x\n", mcu_ver.commit_id);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    112G SerDes version: -\n");
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    56G  SerDes version: -\n");
    }
    else if(DRV_IS_TMG(lchip))
    {
        MCHIP_DMPS_CB(mcu_get_version, lchip, &mcu_ver);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    MCU version\n");
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Date   Code: %08x\n", mcu_ver.date);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    Commit Code: %08x\n", mcu_ver.commit_id);
        MCHIP_DMPS_CB(serdes_get_fw_version, lchip, (void*)serdes_ver);
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    32G SerDes version: %u.%u.%u.%u\n", 
            serdes_ver[0].v_major, serdes_ver[0].v_minor, serdes_ver[0].v_patch, serdes_ver[0].v_build);
    }
    else
    {
        if (DRV_IS_TSINGMA(lchip))
        {
            SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    T.129473 52660 ");
            CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, SYS_TSINGMA_MCU_3_VERSION_BASE_ADDR, &mcu_version));
            SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"%x ", mcu_version);
            CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, (SYS_TSINGMA_MCU_3_VERSION_BASE_ADDR+0x4), &mcu_version));
            SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"%x\n", mcu_version);
            CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, SYS_TSINGMA_MCU_0_VERSION_BASE_ADDR, &mcu_version));
        }
        else
        {
            CTC_ERROR_RETURN(sys_usw_mcu_chip_read(lchip, SYS_USW_MCU_VER_BASE_ADDR, &mcu_version));
        }
        
        mcu_ver_minor = mcu_version & 0xff;
        mcu_ver_major = (mcu_version >> 8) & 0xff;
        SYS_MAC_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"    MCU version %d.%d \n",
        mcu_ver_major, mcu_ver_minor);
    }

    return CTC_E_NONE;
}

int32
sys_usw_mac_mcu_init(uint8 lchip)
{
    uint32 i = 0;
    uint8 gchip_id = 0;
    uint32 tbl_id = 0;
    uint32 fld_id = 0;
    uint32 cmd = 0;
    uint32 tmp_val32 = 0;
 
    tbl_id = McuSupInterruptNormal0_t;
    fld_id = McuSupInterruptNormal0_mcuSupDataMemEccError_f;
    tmp_val32 = 1;
    cmd = DRV_IOW(tbl_id, fld_id);
    CTC_ERROR_RETURN(DRV_FIELD_IOCTL(lchip, 2, cmd, &tmp_val32));

    tbl_id = McuSupRstCtl0_t;
    fld_id = McuSupRstCtl0_mcuSoftRst_f;
    cmd = DRV_IOR(tbl_id, fld_id);
    CTC_ERROR_RETURN(DRV_FIELD_IOCTL(lchip, 0, cmd, &tmp_val32));
    if (!tmp_val32)
    {
        return CTC_E_NONE;
    }

    for (i = 0; i < sizeof(g_usw_mcu_prog)/sizeof(g_usw_mcu_prog[0]); i++)
    {
        if (-1 == g_usw_mcu_prog[i])
        {
            continue;
        }
        CTC_ERROR_RETURN(sys_usw_mcu_chip_write(lchip, SYS_USW_PROG_MEM_BASE_ADDR0+i*4, g_usw_mcu_prog[i]));
    }

    tbl_id = McuSupTimerCtl0_t;
    fld_id = McuSupTimerCtl0_cfgProcTimer_f;
    tmp_val32 = 0x800;
    cmd = DRV_IOW(tbl_id, fld_id);
    CTC_ERROR_RETURN(DRV_FIELD_IOCTL(lchip, 0, cmd, &tmp_val32));

    tbl_id = McuSupRstCtl0_t;
    fld_id = McuSupRstCtl0_mcuSoftRst_f;
    tmp_val32 = 0;
    cmd = DRV_IOW(tbl_id, fld_id);
    CTC_ERROR_RETURN(DRV_FIELD_IOCTL(lchip, 0, cmd, &tmp_val32));

    /* set mcu global enable */
    CTC_ERROR_RETURN(sys_usw_mac_set_mcu_enable(lchip, 1));

    /* set mcu per-port enable */
    for (i = 0; i < SYS_PHY_PORT_NUM_PER_SLICE; i++)
    {
        CTC_ERROR_RETURN(sys_usw_get_gchip_id(lchip, &gchip_id));
        CTC_ERROR_RETURN(sys_usw_mac_set_mcu_port_enable(lchip, CTC_MAP_LPORT_TO_GPORT(gchip_id, i), 1));
    }

    return CTC_E_NONE;
}

int32
sys_usw_mcu_hw_lock(uint8 lchip, uint8 core_id, uint32 core_mcu_id, uint8 grand_id, uint8 bit)
{
    uint32 value      = 0;
    uint32 cmd        = 0;
    uint32 entry_id   = 0;
    uint32 inst_id    = core_mcu_id;
    uint32 ext_tbl_id = McpuGrant0ExtCtl_t + grand_id;
    uint32 index      = DRV_INS(inst_id, entry_id);


    if (CTC_WB_ENABLE(lchip) && (CTC_WB_STATUS(lchip) == CTC_WB_STATUS_RELOADING))
    {
        return CTC_E_NONE;
    }

    /* param check */
    if ((grand_id >= MCU_HW_LOCK_MAX_GRANT_ID) || (bit >= MCU_HW_LOCK_MAX_GRAND_BIT_ID))
    {
        return CTC_E_INVALID_PARAM;
    }

    /* Get Lock */
    while(1)
    {
        cmd  = DRV_IOR(ext_tbl_id, DRV_ENTRY_FLAG);
        CTC_ERROR_RETURN(DMPS_DRV_IOCTL_CORE(lchip, index, core_id, cmd, &value));
        
        CTC_BIT_SET(value, bit);

        cmd  = DRV_IOW(ext_tbl_id, DRV_ENTRY_FLAG);
        CTC_ERROR_RETURN(DMPS_DRV_IOCTL_CORE(lchip, index, core_id, cmd, &value));

        cmd  = DRV_IOR(ext_tbl_id, DRV_ENTRY_FLAG);
        CTC_ERROR_RETURN(DMPS_DRV_IOCTL_CORE(lchip, index, core_id, cmd, &value));

        if (CTC_IS_BIT_SET(value, bit))
        {
            break;
        }
    }

    return CTC_E_NONE; 
}

int32
sys_usw_mcu_hw_unlock(uint8 lchip, uint8 core_id, uint32 core_mcu_id, uint8 grand_id, uint8 bit)
{
        uint32 val_write  = 0;
        uint32 cmd        = 0;
        uint32 entry_id   = 0;
        uint32 inst_id    = core_mcu_id;
        uint32 ext_tbl_id = McpuGrant0ExtCtl_t + grand_id;
        uint32 index      = DRV_INS(inst_id, entry_id);
    

    if (CTC_WB_ENABLE(lchip) && (CTC_WB_STATUS(lchip) == CTC_WB_STATUS_RELOADING))
    {
        return CTC_E_NONE;
    }

    /* param check */
    if ((grand_id >= MCU_HW_LOCK_MAX_GRANT_ID) || (bit >= MCU_HW_LOCK_MAX_GRAND_BIT_ID))
    {
        return CTC_E_INVALID_PARAM;
    }
    
    /* unlock */
    cmd  = DRV_IOR(ext_tbl_id, DRV_ENTRY_FLAG);
    CTC_ERROR_RETURN(DMPS_DRV_IOCTL_CORE(lchip, index, core_id, cmd, &val_write));
        
    CTC_BIT_UNSET(val_write, bit);
    
    cmd  = DRV_IOW(ext_tbl_id, DRV_ENTRY_FLAG);
    CTC_ERROR_RETURN(DMPS_DRV_IOCTL_CORE(lchip, index, core_id, cmd, &val_write));
    
    return CTC_E_NONE;
}


